const Layout = () => import("@/layout/index.vue");
import systemSettingSvg from "@/assets/svg/systemSetting.svg?component";
import interfaceSvg from "@/assets/svg/interface.svg?component";
import communitySvg from "@/assets/svg/community.svg?component";
import bigDiseaseSvg from "@/assets/svg/bigDisease.svg?component";
import expressSvg from "@/assets/svg/express.svg?component";
import xuanchuanSvg from "@/assets/svg/xuanchuan.svg?component";

export default [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录",
      showLink: false,
      rank: 101
    }
  },
  {
    path: "/redirect",
    component: Layout,
    meta: {
      icon: "homeFilled",
      title: "首页",
      showLink: false,
      rank: 104
    },
    children: [
      {
        path: "/redirect/:path(.*)",
        name: "redirect",
        component: () => import("@/layout/redirect.vue")
      }
    ]
  },
  {
    path: "/bigDisease",
    name: "bigDisease",
    component: Layout,
    redirect: "/bigDisease/overview",
    meta: {
      title: "大病保障",
      icon: bigDiseaseSvg,
      rank: 35
    },
    children: [
      {
        path: "/bigDisease/overview",
        component: () => import("@/views/bigDisease/overview.vue"),
        meta: {
          title: "保障概览",
          showParent: true,
          showLink: true
        }
      },
      {
        path: "/bigDisease/order",
        component: () => import("@/views/bigDisease/order.vue"),
        meta: {
          title: "大病保单查询",
          showLink: false
        }
      }
    ]
  },
  {
    path: "/express",
    name: "express",
    component: Layout,
    redirect: "/express/monthAccount",
    meta: {
      title: "配送管理",
      icon: expressSvg,
      rank: 35
    },
    children: [
      {
        path: "/express/monthAccount",
        component: () => import("@/views/express/monthAccount.vue"),
        meta: {
          title: "月度结算",
          showLink: true,
          showParent: true
        }
      },
      {
        path: "/express/quarterPlan",
        component: () => import("@/views/express/quarterPlan.vue"),
        meta: {
          title: "季度计划",
          showLink: false
        }
      },
      {
        path: "/express/yearForcast",
        component: () => import("@/views/express/yearForcast.vue"),
        meta: {
          title: "年度预测",
          showLink: false
        }
      }
    ]
  },
  {
    path: "/publicity",
    name: "publicity",
    component: Layout,
    redirect: "/publicity/index",
    meta: {
      title: "宣传推广",
      icon: xuanchuanSvg,
      rank: 40
    },
    children: [
      {
        path: "/publicity/index",
        component: () => import("@/views/publicity/index.vue"),
        meta: {
          title: "短信群发"
        }
      },
      {
        path: "/publicity/plan",
        component: () => import("@/views/publicity/plan.vue"),
        meta: {
          title: "宣传方案"
        }
      },
      {
        path: "/publicity/message",
        component: () => import("@/views/publicity/message.vue"),
        meta: {
          title: "消息列表",
          showLink: false
        }
      },
      {
        path: "/publicity/screen",
        component: () => import("@/views/publicity/screen.vue"),
        meta: {
          title: "数据大屏"
        }
      }
    ]
  },
  {
    path: "/community",
    name: "community",
    component: Layout,
    redirect: "/community/index",
    meta: {
      title: "社区服务",
      icon: communitySvg,
      rank: 50,
      showLink: false
    },
    children: [
      {
        path: "/community/index",
        component: () => import("@/views/community/index.vue"),
        meta: {
          title: "服务网点",
          showParent: true,
          showLink: true
        }
      }
    ]
  },
  {
    path: "/system",
    name: "system",
    component: Layout,
    meta: {
      title: "系统对接",
      icon: interfaceSvg,
      rank: 60
    },
    redirect: "/system/index",
    children: [
      {
        path: "/system/index",
        component: () => import("@/views/system/index.vue"),
        meta: {
          title: "接口对接"
        }
      }
      // {
      //   path: "/system/article",
      //   component: () => import("@/views/system/article.vue"),
      //   meta: {
      //     title: "对接文档"
      //   }
      // }
    ]
  },
  {
    path: "/setting",
    name: "setting",
    component: Layout,
    redirect: "/setting/user",
    meta: {
      title: "系统设置",
      icon: systemSettingSvg,
      rank: 70,
      roles: ["saas.system.settings"]
    },
    children: [
      {
        path: "/setting/user",
        component: () => import("@/views/setting/user.vue"),
        meta: {
          title: "用户管理"
        }
      },
      {
        path: "/setting/address",
        component: () => import("@/views/setting/address.vue"),
        meta: {
          title: "地区目标"
        }
      },
      {
        path: "/setting/content",
        component: () => import("@/views/setting/content.vue"),
        meta: {
          title: "内容管理"
        }
      }
    ]
  }
] as Array<RouteConfigsTable>;
